package com.example.netty.config;

import com.example.netty.channel.BootNettyServer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: lichong
 * @Date: 2020/1/20 11:11
 * @Description:
 */
@Configuration
public class NettyConfig {
    @Value("${socket.port}")
    private Integer port;

    @Bean
    public BootNettyServer runSocket() {
        BootNettyServer bootNettyServer = new BootNettyServer(port);
        bootNettyServer.run();
        return bootNettyServer;
    }
}
